package org.bitoy.shimmer.common.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import org.springframework.validation.BindException;

public enum Gender implements DisplayableEnum {
    MALE("男", "帅哥"),
    FEMALE("女", "美女");

    public String desc1;
    public String desc2;

    Gender(String desc1, String desc2) {
        this.desc1 = desc1;
        this.desc2 = desc2;
    }

    @JsonValue
    @Override
    public String serialize() {
        return desc1;
    }

    @JsonCreator
    static Gender deserialize(String source) throws BindException {
        return DisplayableEnum.getEnum(Gender.class, source);
    }

}
